import { Configuration, OpenAIApi } from 'openai'
import request from '../../util/request.js'
/**
 * 
 * @param {*} data 
 * @param {*} headers 
 * @returns 
 */

const configuration = new Configuration({
  organization: '',
  apiKey: process.env.GPT_KEY
})

const openai = new OpenAIApi(configuration)

export const postGPT = async (data,config) => {
  return openai.createChatCompletion(data,config)
}